package com.cytech.cloudclinic.moudle.updatepsw;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.EditText;

import com.cytech.cloudclinic.MainActivity;
import com.cytech.cloudclinic.R;
import com.cytech.cloudclinic.base.BaseActivity;
import com.yechaoa.yutils.SpUtil;

import butterknife.BindView;
import butterknife.OnClick;

import static com.cytech.cloudclinic.app.Constant.USER_TOKEN;

public class UpdatePasswordActivity extends BaseActivity<UpdatePasswordPresenter> implements UpdatePasswordView {
    @BindView(R.id.et_login_account)
    EditText etAccount;
    @BindView(R.id.et_login_password)
    EditText etPassword;

    public static void actionStart(Context context){
        Intent intent = new Intent(context, UpdatePasswordActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected UpdatePasswordPresenter createPresenter() {
        return new UpdatePasswordPresenter(this);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.act_login;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @OnClick(R.id.btn_login)
    public void login(View view){
        //MainActivity.actionStart(this);
        presenter.login("13264616071","123");
    }

    @Override
    public void loginSuccess(String token) {
        SpUtil.setString(USER_TOKEN,token);
        MainActivity.actionStart(this);
        finish();
    }
}
